package com.lsh.payment.core.model.payenum;

/**
 * Project Name: lsh-payment
 *
 * @author peter
 * @date 16/10/26
 * 北京链商电子商务有限公司
 * Package
 * desc:
 */
public enum PayChannel {
    /**
     *
     */
    ALIPAY("alipay", 1),
    WXPAY("wxpay", 2),
    LKLPAY("lklpay", 5),
    QFPAY("qfpay", 6),
    DMALLPAY("dmallpay", 7),
    PURSE_ON_CREDIT_PAY("purse_on_credit_pay", 9),
    PURSE_BALANCE_PAY("purse_balance_pay", 10),
    PURSE_PRE_PAY("purse_pre_pay", 11),
    XYPAY("xypay", 16),
    CMBCPAY("cmbcpay", 17),
    ALLINPAY("allinpay", 18),
    IPCPAY("ipcpay", 19),
    CMPAY("cmpay", 21),
    WXPAYGROUPON("wxpaygroupon", 20);

    private String name;

    private int code;

    PayChannel(String name, int code) {
        this.name = name;
        this.code = code;
    }

    public static PayChannel getPayChannel(String name) {
        for (PayChannel it : PayChannel.values()) {
            if (it.getName().equals(name)) {
                return it;
            }
        }

        return null;
    }

    public String getName() {
        return name;
    }

    public int getCode() {
        return code;
    }
}
